<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path;
%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="<%=basePath%>/static/js/jquery-3.3.1.js"></script>
<link rel="stylesheet" type="text/css"
	href="<%=basePath%>/static/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css"
	href="<%=basePath%>/static/css/basic.css">
<script src="<%=basePath%>/static/js/bootstrap.min.js"></script>
</head>
<body>
	<!--头部-->
	<nav class="navbar navbar-inverse navbar-fixed-top">
		<div class="container-fluid">
			<!-- Brand and toggle get grouped for better mobile display -->
			<div class="navbar-header">
				<button type="button" class="navbar-toggle collapsed"
					data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"
					aria-expanded="false">
					<span class="sr-only">Toggle navigation</span> <span
						class="icon-bar"></span> <span class="icon-bar"></span> <span
						class="icon-bar"></span>
				</button>
				<a class="navbar-brand" href="<%=path%>/reader/reader">欢迎来到图书管理系统</a>
			</div>

			<!-- Collect the nav links, forms, and other content for toggling -->
			<div class="collapse navbar-collapse"
				id="bs-example-navbar-collapse-1">
				<ul class="nav navbar-nav navbar-right">
					<!--<li><a href="javascript:;" class="btn btn-default btn-login">登录</a></li>-->
					<li class="dropdown" style="margin-top: 5px;"><a href="#"
						class="dropdown-toggle" data-toggle="dropdown" role="button"
						aria-haspopup="true" aria-expanded="false"> <span
							class="glyphicon glyphicon-user"></span> 欢迎您， ${reader.name } <span
							class="caret"></span></a>
						<ul class="dropdown-menu" style="margin-top: 2px">
							<li><a href="<%=path%>/">退出</a></li>
						</ul></li>
				</ul>
			</div>
			<!-- /.navbar-collapse -->
		</div>
		<!-- /.container-fluid -->
	</nav>

	<!--主体-->
	<div class="container-fluid" id="main">
		<div class="row">
			<div class="col-md-3 left-content">
				<div class="aside-nav">
					<ul class="list-group aside-nav-list">
						<li class="list-group-item "><a href="<%=path%>/lesson/reader/chooseTest">在线考试
								<span class="pull-right glyphicon glyphicon-chevron-right"></span>
						</a></li>
						<li class="list-group-item active"><a href="<%=path%>/results/reader/selectResults">个人成绩查询
								<span class="pull-right glyphicon glyphicon-chevron-right"></span>
						</a></li>
						
						
						
						<!--<li class="list-group-item">Dapibus ac facilisis in</li>-->
						<!--<li class="list-group-item">Morbi leo risus</li>-->
						<!--<li class="list-group-item">Porta ac consectetur ac</li>-->
						<!--<li class="list-group-item">Vestibulum at eros</li>-->
					</ul>
				</div>
			</div>
			<div class="col-md-9 right-content">
				<div class="section-wrap">
					<div class="wrap-top">
						<div class="panel panel-default">
							<div class="panel-heading">试题信息管理</div>
							<div class="panel-body">
							
								<form class="form-horizontal" action="<%=path%>/results/reader/selectResultsInfo" method="post">
									
									<div class="form-group col-md-6">
										<label for="typeName"
											class="col-sm-3 control-label text-right">课程名称</label>
										<div class="col-sm-9">
											<select class="form-control" id="lessonId" name="lessonId">
												<c:forEach items="${lessons}" var="lessonId">
													<option value=${lessonId.lessonId }>${lessonId.lessonName }</option>
												</c:forEach>
											</select>
										</div>
									</div>
									
									<div class="form-group col-md-6">
										<label for="bookName"
											class="col-sm-3 control-label text-right">考试日期</label>
										<div class="col-sm-9">
											<input type="text" class="form-control" id="date"
												name="date" placeholder="yyyy-MM-dd">
										</div>
									</div>
									<div
										class="form-group col-md-3 col-xs-3 col-xs-offset-3 last-form-group">
										<button class="btn btn-default btn-primary" type="submit">查询</button>
									</div>
								</form>
							</div>
						</div>
					</div>
					<div class="wrap-bottom">
						<table class="table table-bordered">
							<thead>
								<tr>
									<th>考试编号</th>
									<th>课程编号</th>
									<th>课程名称</th>
									<th>读者编号</th>
									<th>读者姓名</th>
									<th>考试成绩</th>
									<th>考试时间</th>
								</tr>
							</thead>
							<tbody>
								<c:forEach var="list" items="${bean.list}">
									<tr>
										<td>${list.resultsId}</td>
										<td>${list.lessonId}</td>
										<td>${list.lessonName}</td>
										<td>${list.readerId}</td>
										<td>${list.name}</td>
										<td>${list.result}</td>
										<td>${list.date}</td>
									</tr>
								</c:forEach>
							</tbody>
						</table>
					</div>
					<div class="page-nav text-right">
						<nav aria-label="Page navigation">
							<ul class="pagination">
								<li><a href="#">第${bean.pageNum}页/共${bean.totalPage}页</a></li>
								<li><a href="<%=path%>/results/reader/selectResultsInfo/1">首页</a></li>
								<%--如果当前为第一页时,就没有上一页这个超链接显示 --%>
								<c:if test="${bean.pageNum==1}">
									<c:forEach begin="${bean.start }" end="${bean.end }" step="1"
										var="i">
										<c:if test="${bean.pageNum ==i}">
											<li><a href="#">${i}</a></li>
										</c:if>
										<c:if test="${bean.pageNum !=i}">
											<li><a href="<%=path%>/results/reader/selectResultsInfo/${i}">${i}</a></li>
										</c:if>
									</c:forEach>
									<li><a
										href="<%=path%>/results/reader/selectResultsInfo/${bean.pageNum+1}"
										aria-label="Next"> <span aria-hidden="true">&raquo;</span>
									</a></li>
								</c:if>
								<%--如果当前页不是第一页也不是最后一页,则有上一页和下一页 这个超链接的显示--%>
								<c:if test="${bean.pageNum >1 && bean.pageNum < bean.totalPage}">
									<li><a href="<%=path%>/results/reader/selectResultsInfo/${bean.pageNum-1}" aria-label="Previous"> <span
											aria-hidden="true">&laquo;</span>
									</a></li>
									<c:forEach begin="${bean.start }" end="${bean.end }" step="1"
										var="i">

										<c:if test="${bean.pageNum == i }">
											<li><a href="#">${i }</a></li>
										</c:if>
										<c:if test="${bean.pageNum != i }">
											<li><a href="<%=path%>/results/reader/selectResultsInfo/${i}">${i}</a></li>
										</c:if>
									</c:forEach>
									<li><a
										href="<%=path%>/results/reader/selectResultsInfo/${bean.pageNum+1}"
										aria-label="Next"> <span aria-hidden="true">&raquo;</span>
									</a></li>
								</c:if>
								<%--如果当前页是最后一页,则只有上一页这个超链接显示,下一页没有 --%>
								<c:if test="${bean.pageNum ==  bean.totalPage}">
									<li><a href="<%=path%>/results/reader/selectResultsInfo/${bean.pageNum-1}" aria-label="Previous"> <span
											aria-hidden="true">&laquo;</span>
									</a></li>
									<c:forEach begin="${bean.start }" end="${bean.end }" step="1"
										var="i">

										<c:if test="${bean.pageNum == i }">
											<li><a href="#">${i }</a></li>
										</c:if>
										<c:if test="${bean.pageNum != i }">
											<li><a href="<%=path%>/results/reader/selectResultsInfo/${i}">${i}</a></li>
										</c:if>
									</c:forEach>
								</c:if>
									<li><a href="<%=path%>/results/reader/selectResultsInfo/${bean.totalPage }">尾页</a></li>
							</ul>
						</nav>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>